package main

import (
	"fmt"
	"testing"
)

func main() {
	var arr1 = [5]int{11, 22}
	fmt.Println(len(arr1))
	arr2 := [3]int{2, 3, 4}
	arr3 := [...]int{10, 20, 30}
	fmt.Println(arr1, arr2, arr3)
	var grid [4][5]int
	// 四行五列
	fmt.Println(grid)
	for i := 0; i < len(arr3); i++ {
		fmt.Println(arr3[i])
	}
	for _, item := range arr3 {
		fmt.Println(item) // 不使用索引
	}
}

func TestSliceLenCap(t *testing.T) {
	var arr = [5]int{1, 22, 333, 444, 5555}
	var s1 = arr[1:3]
	t.Log(len(s1), cap(s1))
}
